package com.example.demo.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    @Override
    //静态资源映射，前端可通过图片路径访问的/front/images/*
   public void addResourceHandlers(ResourceHandlerRegistry registry){
        registry.addResourceHandler("/front/images/**").addResourceLocations("classpath:/front/images/");
    }
}
